package com.wzcl.app.dao.model;


import com.wzcl.app.dao.model.common.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

@Data
@Entity
@Table(name = "topic_and_knowledge_point")
@ApiModel(value = "题目知识点关联表")
@EntityListeners(AuditingEntityListener.class)
public class TopicAndKnowledgePoint implements Base {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ManyToOne(fetch = FetchType.EAGER)
    @ApiModelProperty(value = "题目")
    @JoinColumn(name="topicId")
    private Topic topic;

    @ManyToOne(fetch = FetchType.EAGER)
    @ApiModelProperty(value = "知识点")
    @JoinColumn(name="knowledgePointId")
    private KnowledgePoint knowledgePoint;
}
